import request from '@/utils/request'

const baseURL = '/admin/order'

// 获取订单列表
export const getOrderList = (params) => {
  return request.get(`${baseURL}/list`, {
    params: {
      ...params,
      pageNum: params.pageNum || 1,
      pageSize: params.pageSize || 10
    }
  })
}

// 获取订单详情
export const getOrderDetail = (id) => {
  return request.get(`${baseURL}/detail`, { params: { id } })
}

// 取消订单
export const cancelOrder = (id) => {
  return request.post(`${baseURL}/cancel`, null, {
    params: { id }
  })
}

// 发货
export const deliverOrder = (id) => {
  return request.post(`${baseURL}/deliver`, null, {
    params: { id }
  })
}

// 确认退货
export const returnOrder = (id) => {
  return request.post(`${baseURL}/return`, null, {
    params: { id }
  })
} 